<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/wesite/view/common/base.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>帮助中心</title>
    <%@ include file="/wesite/view/common/common.jsp"%>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="${webctx}/css/aui.2.0.css"/>
    <link rel="stylesheet" type="text/css" href="${webctx}/css/style.css"/>
    <script type="text/javascript" src="${webctx}/script/aui-dialog.js" ></script>
    <script type="text/javascript" src="${webctx}/script/aui-scroll.js" ></script>
    <script type="text/javascript" src="${webctx}/script/api.js"></script>
    <script type="text/javascript" src="${webctx}/script/common.js"></script>
    <script type="text/javascript" src="${webctx}/script/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="${webctx}/script/jufuda.js"></script>
</head>
<style>
    .public-m ul{
        padding-left: .533333rem;
        background-color: #fff;
    }
    .public-m li{
        height: 2.666667rem;
        line-height: 2.666667rem;
        background: #fff;
        border-bottom: #eee 1px solid;
        padding: 0 0.8rem;
        position: relative;
    }
    .public-m li:last-child{
        border-bottom: none;
    }
    .public-m .arrow-r{
        background: url(${webctx}/images/ico-arrow-r.png) right center no-repeat;
        background-size: 0.8rem;
        display: block;
        width: 0.8rem;
        height: 0.8rem;
        position: absolute;
        right: 0.8rem;
        top: 50%;
        margin-top: -0.373333rem;
    }
    .public-m a{
        font-size: 0.8rem;
        color: #212121;
    }
</style>
<body>
<div class="help-center public-m">
    <ul class="list">

    </ul>
    <div id="list" style=" margin: 10px 0; color: #999; text-align: center;display: none;"></div>
</div>
<script src="${webctx}/script/aui-toast.js"></script>
</body>
<script src="${ctx }/plugins/artTemplate/dist/template.js"></script>
<script type="text/html" id="productHtml_list">
    {{each list as info i}}
    <li>
        <a style="display: block;" href="javascript:details('{{info.id }}','{{info.type }}','{{info.url }}');">
            <span>{{info.title}}</span>
            <span class="arrow-r"></span>
        </a>
    </li>
    {{/each}}
</script>
<script>
    function details(id,type,url){
        if(type==2)window.open(url);
        else if(type==3)window.open(ctx+"/we/article/details?id="+id);
    }

    var hotsLoading = false;
    var IPageNo = 1;
    function loadproducts() {
        if (hotsLoading){
            return false;
        }else {
            hotsLoading = true;
        }
        $("#list").text("正在加载 ...").show();
        $w.httpRequest({
            url: apiroot + "/we/article/info",
            method:"get",
            data: {
                "pno":IPageNo,
                'code':"002012"
            },
            ok: function (ret) {
                hotsLoading = false;
                productdata = ret.Data;
                if (productdata &&  productdata.length > 0) {

                IPageNo++;
                $("#list").hide();
                showProducts();
            }else{
                IPageNo = 0;
                $("#list").text("已加载全部");
            }
        }})
    }
    function showProducts() {
        var h = template('productHtml_list',{
            ctx:ctx,
            fileserver:getRandomFileserver(),
            isuserauth:isuserauth,
            islogin:islogin,
            list:productdata
        });
        $(".list").append(h);
    }
    $(function () {
        loadproducts();
    });
    var  buttomHeight = $("div.h98").height()*2;
    var scroll = new auiScroll({
        listen:true, //是否监听滚动高度，开启后将实时返回滚动高度
        distance:buttomHeight, //判断到达底部的距离，isToBottom为true
    },function(ret){
        if (ret.isToBottom){
            if (IPageNo > 0 && IPageNo){
                var toast = new auiToast({});
                toast.loading({
                    title: "加载中",
                    duration: 300

                },function (ret) {
                    setTimeout(function () {
                        toast.hide();
                    },300)
                });
                loadproducts();
            }
        }
    });


</script>

</html>
